/*
 * @Description  :
 * @Author       : YiDing Xue
 * @Date         : 2023-02-24
 * @LastEditors  : YiDing Xue
 * @LastEditTime : 2023-02-24
 */
import { request } from '@/utils'
const API = {
  getVisaCountryListUrl: '/third/visa/openvisa/sys-config-get', // 首页数据1
  getAddressConfigUrl: '/third/visa/openvisa/get-address-config', // 获取国内三级联动地址
  productBriefQueryUrl: '/third/visa/openvisa/product-brief-query', // 商品列表查询
  productDetailQueryUrl: '/third/visa/openvisa/product-query', // 商品列表查询
  getAddressConfigUrl: '/third/visa/openvisa/get-address-config', // 省市区查询
  addOrderUrl: '/third/visa/openvisa/order-add', // 创建订单
  uploadFileMaterialUrl: '/third/visa/upload/file-list', // 上传文件到订单
  orderListUrl: '/third/visa/query-order/list/v2', // 订单列表
  getOrderDetailUrl: '/third/visa/openvisa/order-query/v2', // 订单详情
  getOrderUploadFileUrl: '/third/visa/upload/file/already/list', // 获取已经上传的文件列表
  getConsulateCityListUrl: '/third/visa/openvisa/country-embassy-get', // 查询国家使馆信息
  applicantMaterialAddUrl: '/third/visa/openvisa/applicant-material-add', // 提交申请人资料
  applicantMaterialUpdateUrl: '/third/visa/openvisa/applicant-material-update', // 更新申请人资料
  getMaterialUploadListUrl: '/third/visa/upload/file/already/list/v2', // 获取已上传的文件列表
  productPriceQueryUrl: '/third/visa/openvisa/product-price-query', // 提交申请人资料
  getUploadSignUrl: '/third/visa/upload/file/get-sign', // 上传文件-获取sign 获取上传图片的凭证
  refundPayUrl: '/yeepay/refund-pay?orderNo=', // 上传文件-获取sign 获取上传图片的凭证
  applicantReverifyUrl: '/third/visa/openvisa/applicant-reverify' // 上传文件-获取sign 获取上传图片的凭证
}
const getVisaCountryList = () => request.get(API.getVisaCountryListUrl)
const getVisaProvinceList = () => request.get(API.getAddressConfigUrl)
const getProvinceAddress = () => request.get(API.getAddressConfigUrl)
const productBriefQuery = playData => request.post(API.productBriefQueryUrl, playData)
const addOrder = playData => request.post(API.addOrderUrl, playData)
const uploadFileMaterial = playData => request.post(API.uploadFileMaterialUrl, playData)
const submitApplicantMaterial = playData => request.post(API.applicantMaterialAddUrl, playData)
const updateApplicantMaterial = playData => request.post(API.applicantMaterialUpdateUrl, playData)
const productDetailQuery = product_id => request.get(API.productDetailQueryUrl, { params: { product_id } })
const productPriceQuery = product_id => request.get(API.productPriceQueryUrl, { params: { product_id } })
const getUploadSign = uid => request.get(API.getUploadSignUrl, { params: { uid } })
const getConsulateCityList = country_id => request.get(API.getConsulateCityListUrl, { params: { country_id } })
const getOrderList = params => request.get(API.orderListUrl, { params: params })
const getOrderUploadFile = params => request.get(API.getOrderUploadFileUrl, { params: params })
const getMaterialUploadList = params => request.get(API.getMaterialUploadListUrl, { params: params })
const getOrderDetail = orderNo => request.get(API.getOrderDetailUrl, { params: { orderNo } })
const applicantReverify = params => request.get(API.applicantReverifyUrl, { params: params })
const refundPay = orderNo => request.post(API.refundPayUrl + orderNo)

export {
  getVisaCountryList,
  getVisaProvinceList,
  productBriefQuery,
  productDetailQuery,
  getProvinceAddress,
  addOrder,
  getOrderList,
  getOrderDetail,
  getOrderUploadFile,
  getConsulateCityList,
  submitApplicantMaterial,
  updateApplicantMaterial,
  getMaterialUploadList,
  productPriceQuery,
  getUploadSign,
  uploadFileMaterial,
  refundPay,
  applicantReverify
}
